package cn.java76.springboot.demo1.controller;

import cn.java76.springboot.demo1.config.Sms;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author oldliu
 * @since 1.0
 */
@RestController
public class ConfigDemoController {

    @Value("${laoliu.config.name}")
    private String name;

    //上传文件的路径

    //@Value("6666")
    @Value("${server.port}")
    private int port;

    @Autowired
    private Sms sms;


    @GetMapping("showconfig1")
    public String show(){

        return "name="+name+",端口："+port;
    }


    @GetMapping("showsms")
    public String showMsg(){
//        Sms s=new Sms();
//        s.setIsp("移动");
//        s.setContent("@@sdfdf!!!!!");
        return String.valueOf(sms);
    }
}
